﻿//----------------------------------------------------------------
//CodeArt.
//
//文件描述:
//
//创 建 人: dreamnan@hotmail.com(Blog:http://www.cnblogs.com/dreamnan)
//创建日期: 2009-10-15
//
//修订记录: 
//
//----------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
using System.Security.Permissions;

using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.Security;
using System.Threading;
using System.Xml;
using System.Web;
using System.Text;
using System.Collections.Generic;
using System.Collections.Specialized;


namespace CodeArt.SharePoint.Fields
{
    [CLSCompliant(false)]
    [SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel = true)]
    public class SPPickerLookupField : SPSiteLookupField
    {
        public SPPickerLookupField(SPFieldCollection fields, string fieldName) : base(fields, fieldName)
        {
        }

        public SPPickerLookupField(SPFieldCollection fields, string typeName, string displayName)
            : base(fields, typeName, displayName)
        {

        }
        public override BaseFieldControl FieldRenderingControl
        {
            get
            {
                BaseFieldControl _renderingControl = null;

                if (this.AllowPickerDialog)
                {             
                    _renderingControl = new PickerLookupFieldControl();
                }
                else
                {
                    _renderingControl = new LookupField();
                }

                _renderingControl.FieldName = InternalName;                
                return _renderingControl;

            }
        }

    }
}
